<template>
  <z-paging ref="pagingRef" v-model="infoList" @query="queryDate">
    <view v-for="(item, index) in infoList" :key="index">
        <up-cell :title="item.title"></up-cell>
    </view>
  </z-paging>
</template>

<script setup lang="ts">
  import { onLoad } from "@dcloudio/uni-app";
  import { ref } from 'vue';
import  { getInfoList } from '@/api/common/index';
import zPaging from 'z-paging/components/z-paging/z-paging.vue';

const pagingRef = ref<InstanceType<typeof zPaging> | null>(null);

const infoList = ref([]);

onLoad(async () => {
  const mdata = await getInfoList({pageNo: 1, pageSize: 20, tid: 1});
  infoList.value = mdata.list;
})

const queryDate = async (pageNo, pageSize) => {
  const mdata = await getInfoList({pageNo, pageSize, tid: 1});
  pagingRef.value?.complete(mdata.list);
}
</script>
